package sg.edu.nus.iss.vmcs.maintenance;

/*
 * Copyright 2011 ISS.
 * The contents contained in this document may not be reproduced in any
 * form or by any means, without the written permission of ISS, other
 * than for the purpose for which it has been supplied.
 *
 */

import sg.edu.nus.iss.vmcs.system.*;

/**
 * The class enables to create the entity object for password and stores the correct
 * password.
 * @version 1.0  08/12/2011
 * @author Team 7S - SE19
 */

public class Password {

/**
 * This constructor creates an instance of the password object.
 */	
	public Password() {
	}

/**
 * This operation compare the received password with the authorized password string
 * stored in the object, and then return a message to the Access Manager saying
 * whether the password is valid or invalid. 
 * @param psi password entered.
 * @return boolean stating whether true or false.
 */	
	public boolean validatePassword(String psi) {
		// the correct password is obtained from the property file.
		// The input password psi is compared to the correct one from the property file.
		if (psi.compareTo(Environment.getPassword()) == 0)
			return true;
		else
			return false;
	}
}